package com.puneet.graphqueries.ssh;

import java.io.File;
import java.io.IOException;

import com.jcraft.jsch.JSchException;
import com.jcraft.jsch.Session;

public class ScpTo extends SSHBase {
	public void sendFile(String host,String user,String localFile, String remoteFile)  {
		Session session = null;
		try {
			session = openSession(host,user);
			ScpToMessage sm = new ScpToMessage(session,new File(localFile),remoteFile);
			sm.execute();
		} catch (JSchException e) {
			throw new SSHException(e);
		} catch (IOException e) {
			throw new SSHException(e);
		}finally {
			if(session != null) {
				session.disconnect();
			}
		}
	}
}
